Improve testing and documentation for client firewall marks - #13383
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves validation and documentation of the existing client-side firewall mark API (TSHttpTxnClientPacketMarkSet) in ATS by adding a dedicated AuTest-backed plugin test and clarifying API semantics and platform behavior in both the public header and developer docs.
Changes:
- Add an AuTest plugin that sets a client packet mark from a request header and echoes the observed
SO_MARKvalue back in the response. - Add a Linux-only gold test that runs only when
SO_MARKcan be set (e.g., withCAP_NET_ADMIN). - Expand API documentation in
include/ts/ts.hand the developer guide to clarify full-mark replacement semantics, return codes, and non-Linux no-op behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/tools/plugins/CMakeLists.txt | Registers the new autest plugin build target. |
| tests/tools/plugins/client_packet_mark_mask.cc | Implements the test plugin that sets and reads back the client socket mark. |
| tests/gold_tests/pluginTest/client_packet_mark/client_packet_mark_mask.test.py | Adds an AuTest that drives the plugin and asserts the observed mark. |
| include/ts/ts.h | Clarifies client packet mark API semantics, platform behavior, and return codes. |
| doc/developer-guide/api/functions/TSHttpTxnClientPacketMarkSet.en.rst | Updates developer-guide documentation to match the clarified API behavior. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
bneradt
requested changes
Jul 14, 2026
Contributor
Author
|
The new AuTest was skipped in CI. I have no way to test it locally. 😖 |
* Allow PACKET_MARK in sock_option_flag_in * Mention `CAP_NET_RAW` in docstring
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The `PrepareTestPlugin` call already takes care of all that stuff.
Contributor
Author
|
I got my OpenSUSE docker development container working and ran the new AuTest. It passes. |
ezelkow1
self-requested a review
July 14, 2026 22:03
ezelkow1
approved these changes
Jul 14, 2026
bneradt
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are APIs for both client and server firewall marks. I am preparing to add overloaded functions to those APIs to allow setting a mark with a mask per my proposal on the dev mailing list.
This patch does not change behavior or add any new functionality. It adds a test and improved documentation for the existing client-side firewall mark API. I will make an analogous PR for the server-side API to keep them consistent; I opted to split the PR to limit scope.
The new test only runs on Linux, and only when the capability needed to set
SO_MARKis available.Note for reviewer: Copilot found that these APIs return
TS_SUCCESSeven if the OS refuses to let us setSO_MARK(because we have insufficient privileges, for example). I believe this is a bug, and I'm leaving it for future work.